home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / UPDATE- Int&Libs 3.2 / AIncludes / MacLocales.a < prev    next >
Encoding:
Text File  |  1999-05-25  |  5.4 KB  |  167 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MacLocales.a
  3. ;
  4. ;    Contains:    Types & prototypes for locale functions
  5. ;
  6. ;    Version:    Technology:    Veronica
  7. ;                Release:    Veronica Seed, Use with 3.2 Universal Interfaces
  8. ;
  9. ;    Copyright:    © 1998-1999 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__MACLOCALES__') = 'UNDEFINED' THEN
  18. __MACLOCALES__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.  
  24.  
  25. ;   -------------------------------------------------------------------------------------------------
  26. ;   ERROR/STATUS CODES
  27. ;   -------------------------------------------------------------------------------------------------
  28.  
  29.  
  30.  
  31.  
  32. kLocalesBufferTooSmallErr        EQU        -30001
  33. kLocalesDefaultDisplayStatus    EQU        -30029                ; Requested display locale unavailable, used default
  34.  
  35. ;   -------------------------------------------------------------------------------------------------
  36. ;   TYPES & CONSTANTS
  37. ;   -------------------------------------------------------------------------------------------------
  38.  
  39.  
  40.  
  41.  
  42.  
  43. ; typedef UInt32                         LocalePartMask
  44.  
  45.  
  46.                                                             ; bit set requests the following:
  47. kLocaleLanguageMask                EQU        $00000001            ; ISO 639-1 or -2 language code (2 or 3 letters)
  48. kLocaleLanguageVariantMask        EQU        $00000002            ; custom string for language variant
  49. kLocaleScriptMask                EQU        $00000004            ; ISO 15924 script code (2 letters)
  50. kLocaleScriptVariantMask        EQU        $00000008            ; custom string for script variant
  51. kLocaleRegionMask                EQU        $00000010            ; ISO 3166 country/region code (2 letters)
  52. kLocaleRegionVariantMask        EQU        $00000020            ; custom string for region variant
  53. kLocaleAllPartsMask                EQU        $0000003F            ; all of the above
  54. ; typedef FourCharCode                     LocaleOperationClass
  55.  
  56.  
  57. kUnicodeCollationClass            EQU        'ucol'
  58. kUnicodeTextBreakClass            EQU        'ubrk'
  59. ; typedef FourCharCode                     LocaleOperationVariant
  60.  
  61. LocaleAndVariant        RECORD 0
  62. locale                     ds.l    1                ; offset: $0 (0)
  63. opVariant                 ds.l    1                ; offset: $4 (4)
  64. sizeof                     EQU *                    ; size:   $8 (8)
  65.                         ENDR
  66. ; typedef UInt32                         LocaleNameMask
  67.  
  68.  
  69.                                                             ; bit set requests the following:
  70. kLocaleNameMask                    EQU        $00000001            ; name of locale
  71. kLocaleOperationVariantNameMask    EQU        $00000002            ; name of LocaleOperationVariant
  72. kLocaleAndVariantNameMask        EQU        $00000003            ; all of the above
  73.  
  74. ;   -------------------------------------------------------------------------------------------------
  75. ;   FUNCTION PROTOTYPES
  76. ;   -------------------------------------------------------------------------------------------------
  77.  
  78.  
  79.  
  80. ;  Convert to or from LocaleRefs 
  81.  
  82. ;
  83. ; extern OSStatus LocaleRefFromLangOrRegionCode(LangCode lang, RegionCode region, LocaleRef *locale)
  84. ;
  85.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  86.         IMPORT_CFM_FUNCTION LocaleRefFromLangOrRegionCode
  87.     ENDIF
  88.  
  89. ;
  90. ; extern OSStatus LocaleRefFromLocaleString(const char *localeString, LocaleRef *locale)
  91. ;
  92.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  93.         IMPORT_CFM_FUNCTION LocaleRefFromLocaleString
  94.     ENDIF
  95.  
  96. ;
  97. ; extern OSStatus LocaleRefGetPartString(LocaleRef locale, LocalePartMask partMask, ByteCount maxStringLen, char *partString)
  98. ;
  99.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  100.         IMPORT_CFM_FUNCTION LocaleRefGetPartString
  101.     ENDIF
  102.  
  103. ;  Enumerate locales for a LocaleOperationClass 
  104.  
  105. ;
  106. ; extern OSStatus LocaleOperationCountLocales(LocaleOperationClass opClass, ItemCount *localeCount)
  107. ;
  108.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  109.         IMPORT_CFM_FUNCTION LocaleOperationCountLocales
  110.     ENDIF
  111.  
  112. ;
  113. ; extern OSStatus LocaleOperationGetLocales(LocaleOperationClass opClass, ItemCount maxLocaleCount, ItemCount *actualLocaleCount, LocaleAndVariant localeVariantList[2147483647])
  114. ;
  115.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  116.         IMPORT_CFM_FUNCTION LocaleOperationGetLocales
  117.     ENDIF
  118.  
  119. ;  Get names for a locale
  120.  
  121. ;
  122. ; extern OSStatus LocaleGetName(LocaleRef locale, LocaleOperationVariant opVariant, LocaleNameMask nameMask, LocaleRef displayLocale, UniCharCount maxNameLen, UniCharCount *actualNameLen, UniChar *displayName)
  123. ;
  124.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  125.         IMPORT_CFM_FUNCTION LocaleGetName
  126.     ENDIF
  127.  
  128. ;
  129. ; extern OSStatus LocaleCountNames(LocaleRef locale, LocaleOperationVariant opVariant, LocaleNameMask nameMask, ItemCount *nameCount)
  130. ;
  131.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  132.         IMPORT_CFM_FUNCTION LocaleCountNames
  133.     ENDIF
  134.  
  135. ;
  136. ; extern OSStatus LocaleGetIndName(LocaleRef locale, LocaleOperationVariant opVariant, LocaleNameMask nameMask, ItemCount nameIndex, UniCharCount maxNameLen, UniCharCount *actualNameLen, UniChar *displayName, LocaleRef *displayLocale)
  137. ;
  138.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  139.         IMPORT_CFM_FUNCTION LocaleGetIndName
  140.     ENDIF
  141.  
  142. ;  Get names for a LocaleOperationClass
  143.  
  144. ;
  145. ; extern OSStatus LocaleOperationGetName(LocaleOperationClass opClass, LocaleRef displayLocale, UniCharCount maxNameLen, UniCharCount *actualNameLen, UniChar *displayName)
  146. ;
  147.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  148.         IMPORT_CFM_FUNCTION LocaleOperationGetName
  149.     ENDIF
  150.  
  151. ;
  152. ; extern OSStatus LocaleOperationCountNames(LocaleOperationClass opClass, ItemCount *nameCount)
  153. ;
  154.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  155.         IMPORT_CFM_FUNCTION LocaleOperationCountNames
  156.     ENDIF
  157.  
  158. ;
  159. ; extern OSStatus LocaleOperationGetIndName(LocaleOperationClass opClass, ItemCount nameIndex, UniCharCount maxNameLen, UniCharCount *actualNameLen, UniChar *displayName, LocaleRef *displayLocale)
  160. ;
  161.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  162.         IMPORT_CFM_FUNCTION LocaleOperationGetIndName
  163.     ENDIF
  164.  
  165.     ENDIF ; __MACLOCALES__ 
  166.  
  167.